package com.wyh.domain.enums.g3enums;

import com.wyh.domain.po.g3po.BillingItemsEnum;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public enum ThreeMeterTypeEnum {//三表
    WATER(0, "水费"),
    ELECTRICITY(1, "电费"),
    GAS(2, "气费");


    private final Integer code;
    private final String description;

    ThreeMeterTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static String getByCode(int code) {
        for (ThreeMeterTypeEnum type : ThreeMeterTypeEnum.values()) {
            if (type.code == code) {
                return type.getDescription();
            }
        }
        return null;
    }

    public static HashMap<Integer, String> getAllThreeMeterType() {
        HashMap<Integer, String> hashMap = new HashMap<>();

        for (ThreeMeterTypeEnum value : ThreeMeterTypeEnum.values()) {
            hashMap.put(value.getCode(),value.getDescription());
        }
        return hashMap;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
